#include "Exception.h"
#include "Utilities.h"

//-------------------------------------------------
CException::CException(const std::string& description)
	: m_sDescription(description)
{

}

//-------------------------------------------------
CException::CException(const std::string& inFile, int inLine, const std::string& inMessage)
{
	std::string line ="";
	Utilities::ToString(line, "%d", inLine);
	std::string description = "";

	description += "----------------------------------------------------\n";
	description += "File:" + inFile + "\n";
	description += "Line:" + line + "\n";
	description += "----------------------------------------------------\n";
	description += "Description:" + inMessage;
	SetDescription (description);
}

//-------------------------------------------------
inline void CException::SetDescription(const std::string& description)
{
	m_sDescription = description;
}

//------------------------------------------------
std::string CException::GetDescription() const
{
	return m_sDescription;
}